//
//  UIView+Animation.m
//  YLLottery
//
//  Created by apple on 2017/11/17.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "UIView+Animation.h"

@implementation UIView (Animation)
- (void)addAnimationWithScaleShrink
{
    CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
    animation.duration = 0.5;
    animation.repeatCount = YES;
    animation.values = @[@0.8,@0.9,@1.0,@1.1,@1.2,@1.1,@1.0,@0.9,@0.8];
    animation.autoreverses = YES;
    // 设置重复次数为无限大
    animation.repeatCount = FLT_MAX;
    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [self.layer addAnimation:animation forKey:nil];
}
@end
